<?php

class Country_Model_DbTable_Photos extends Engine_Db_Table
{
  protected $_rowClass = 'Country_Model_Photo';
  
  
    public function getSellectAllPhotoOfCountry($country_id){
        $photo = Engine_Api::_()->getDbtable('photos','country');
        $aPhoto = Engine_Api::_()->getDbtable('photos','album');
        
        $select = $aPhoto->select()
                         ->setIntegrityCheck(false)
                         ->from($aPhoto->info('name'),"*")
                         ->join($photo->info('name'),$photo->info('name').".p_id = ".$aPhoto->info('name').".photo_id",null)
                         ->where($photo->info('name').".country_id = $country_id");
                        
        return $select;
    }
}
